import request from '@/utils/wy';

// 第一个数组
export interface CategoryData{
    frontName: string,
    id: number,
    name: string
}
export type FinalPriceInfoVOData = {
    banner: {
        content: string
    },
    priceInfo: {
        counterPrice: string,
        finalPrice: {
            price: string
        }
    }

}
export type ItemListData = {
    id: number,
    name: string,
    listPicUrl: string,
    finalPriceInfoVO: FinalPriceInfoVOData
}
export type CategoryItemListData = {
    category: CategoryData,
    // itemIdList: number[],
    itemList: ItemListData
}
export type CategoryItemListData1 = CategoryItemListData[]

// 第二个数组
export interface CategoryListData{
    id: number,
    name: string
}
export type CategoryListData2 = CategoryListData[]

// 第三个数组
export interface BannerListData{
    picUrl: string
}
export type CurrentCateData = {
    bannerList: BannerListData[],
    id: number,
    name: string
}
export type CurrentCategoryData = CurrentCateData[]


export type LivesInfoData = {
    categoryItemList: CategoryItemListData1,//大的商品分类
    categoryList: CategoryListData2, //与首页navList对应的分类列表
    currentCategory: CurrentCategoryData //轮播图
}

export default {
    // 居家生活
    getLives(categoryId: number){
        return request.get<any, LivesInfoData>(`item/list.json?__timestamp=1630136511866&categoryId=${categoryId}`);
    }
}